PSA Object Model Diagrams

MilestoneService

global with sharing class MilestoneService

Service providing functionality relating to Milestones.

Methods

updateExpenseRollupsAsync

global static Id updateExpenseRollupsAsync(Set<Id> milestoneIds)

Recalculates fields on Milestone whose values are calculated from Expenses linked to the Milestone. This version may run asynchronously to handle large volumes of data. If you want the calculation performed immediately, call pse.MilestoneService.updateExpenseRollups(Set<Id> milestoneIds) instead.
The fields that will be updated are:

  • pse__Billable_Expenses_In_Financials__c
  • pse__Billable_Expenses_Submitted__c
  • pse__Non_Billable_Expenses_In_Financials__c
  • pse__Non_Billable_Expenses_Submitted__c
Note that PSA's triggers will keep these fields up to date. However it may be necessary to call this method to correct data in some situations, for example when a milestone is closed.

Input Parameters

Name Type Description
milestoneIds Set<Id> The milestones on which to recalculate the expense rollup fields.

Return Value

The Id of the ApexAsyncJob that performs the calculation. Note this job may create other async jobs. So the rollup process might run for some time after the job in the return value has completed.

Sample Code

//Note: This sample code is for demonstration purposes only. It is not intended for
//use in a production environment, is not guaranteed against defects or errors, and
//is in no way optimized or streamlined.

You need to provide some sample code

updateExpenseRollups

global static Id updateExpenseRollups(Set<Id> milestoneIds)

Recalculates fields on Milestone whose values are calculated from Expenses linked to the Milestone. This version will execute synchronously, but may fail with large volumes of data. If the calculation needs to handle large numbers of expenses or milestones, call pse.MilestoneService.updateExpenseRollupsAsync(Set<Id> milestoneIds) instead.
The fields that will be updated are:

  • pse__Billable_Expenses_In_Financials__c
  • pse__Billable_Expenses_Submitted__c
  • pse__Non_Billable_Expenses_In_Financials__c
  • pse__Non_Billable_Expenses_Submitted__c
Note that PSA's triggers will keep these fields up to date. However it may be necessary to call this method to correct data in some situations, for example when a milestone is closed.

Input Parameters

Name Type Description
milestoneIds Set<Id> The milestones on which to recalculate the expense rollup fields.

Sample Code

//Note: This sample code is for demonstration purposes only. It is not intended for
//use in a production environment, is not guaranteed against defects or errors, and
//is in no way optimized or streamlined.

You need to provide some sample code

updateTimecardRollupsAsync

global static Id updateTimecardRollupsAsync(Set<Id> milestoneIds)

Recalculates fields on Milestone whose values are calculated from Timecards linked to the Milestone. This version may run asynchronously to handle large volumes of data. If you want the calculation performed immediately, call pse.MilestoneService.updateTimecardRollups(Set<Id> milestoneIds) instead.
The fields that will be updated are:

  • pse__Billable_Amount_In_Financials__c
  • pse__Billable_Amount_Submitted__c
  • pse__Billable_Days_In_Financials__c
  • pse__Billable_Days_Submitted__c
  • pse__Billable_Hours_In_Financials__c
  • pse__Billable_Hours_Submitted__c
  • pse__Non_Billable_Days_In_Financials__c
  • pse__Non_Billable_Days_Submitted__c
  • pse__Non_Billable_Hours_In_Financials__c
  • pse__Non_Billable_Hours_Submitted__c
  • pse__Timecard_External_Costs_In_Financials__c
  • pse__Timecard_External_Costs_Submitted__c
  • pse__Timecard_Internal_Costs_In_Financials__c
  • pse__Timecard_Internal_Costs_Submitted__c
Note that PSA's triggers will keep these fields up to date. However it may be necessary to call this method to correct data in some situations, for example when a milestone is closed.

Input Parameters

Name Type Description
milestoneIds Set<Id> The milestones on which to recalculate the timecard rollup fields.

Return Value

The Id of the ApexAsyncJob that performs the calculation. Note this job may create other async jobs. So the rollup process might run for some time after the job in the return value has completed.

Sample Code

//Note: This sample code is for demonstration purposes only. It is not intended for
//use in a production environment, is not guaranteed against defects or errors, and
//is in no way optimized or streamlined.

You need to provide some sample code

updateTimecardRollups

global static Id updateTimecardRollups(Set<Id> milestoneIds)

Recalculates fields on Milestone whose values are calculated from Timecards linked to the Milestone. This version will execute synchronously, but may fail with large volumes of data. If the calculation needs to handle large numbers of timecards or milestones, call pse.MilestoneService.updateTimecardRollupsAsync(Set<Id> milestoneIds) instead.
The fields that will be updated are:

  • pse__Billable_Amount_In_Financials__c
  • pse__Billable_Amount_Submitted__c
  • pse__Billable_Days_In_Financials__c
  • pse__Billable_Days_Submitted__c
  • pse__Billable_Hours_In_Financials__c
  • pse__Billable_Hours_Submitted__c
  • pse__Non_Billable_Days_In_Financials__c
  • pse__Non_Billable_Days_Submitted__c
  • pse__Non_Billable_Hours_In_Financials__c
  • pse__Non_Billable_Hours_Submitted__c
  • pse__Timecard_External_Costs_In_Financials__c
  • pse__Timecard_External_Costs_Submitted__c
  • pse__Timecard_Internal_Costs_In_Financials__c
  • pse__Timecard_Internal_Costs_Submitted__c
Note that PSA's triggers will keep these fields up to date. However it may be necessary to call this method to correct data in some situations, for example when a milestone is closed.

Input Parameters

Name Type Description
milestoneIds Set<Id> The milestones on which to recalculate the timecard rollup fields.

Sample Code

//Note: This sample code is for demonstration purposes only. It is not intended for
//use in a production environment, is not guaranteed against defects or errors, and
//is in no way optimized or streamlined.

You need to provide some sample code
© Copyright 2009–2021 FinancialForce.com, inc. Confidential – all rights reserved. Various trademarks held by their respective owners.